export const commonConfig = {
  activeName: 'colConvert',
  inForeachPrefix: '<foreach collection="list" item="item" separator=",">\n',
  outForeachPrefix: '<foreach collection="list" item="item" open="(" separator="," close=")">\n',
  suffix: '\n</foreach>',
  future: '功能待开发...'
}

export const convertTypeArr = [
  {
    label: 'in语句',
    value: 'in'
  },
  {
    label: 'foreach',
    value: 'foreach'
  }
]
export const convertPlaceholderArr = [
  {
    left: `用来将id转换成sql的in语句。eg.\n1,\n2,\n3`,
    right: `转换后示例。eg.\n (\n'1',\n'2',\n'3'\n)`
  },
  {
    left: `用来将表字段 转换成 foreach语句。eg.\n id,name,real_age`,
    right: `转换后示例
<foreach collection="list" item="item" index="index" separator=",">
  (
    #{item.id},
    #{item.name},
    #{item.realAge}
  )
</foreach>
`
  }
]
export const foreachTypeArr = [
  {
    label: '批量插入',
    value: 'insertBatch'
  },
  {
    label: '批量更新',
    value: 'updateBatch'
  }
]
export const dbOptions = [
  'mysql', 'oracle', 'postgresql'
]
export const generatorOptions = [
  'Entity', 'Mapper', 'Controller', 'Service', 'Impl', 'Xml',
  'Result', 'ApiJs', 'IndexVue', 'FormVue','IndexVue3', 'FormVue3',
  'SearchButtons', 'MockJs'
]

export const batchPlaceholder =
  {
    left: `列字段。eg.
      id,name,real_age
建表语句。eg.
      create table_user(
        id varchar(32),
        name varchar(32),
        real_age int
      ) comment '用户表'`,
    insert_right: `insert into table_name (id, name, real_age)
    values
<foreach collection="list" item="item" separator=",">
  ( 
    #{item.id},
    #{item.name},
    #{item.realAge}
  )
</foreach>`,
    update_right: `insert into table_name (id, name, real_age)
values
<foreach collection="list" item="item" separator=",">
  (
    #{item.id},
    #{item.name},
    #{item.realAge}
  )
</foreach>
ON DUPLICATE KEY UPDATE
id= values(id),
name= values(name),
real_age= values(real_age)`
  }

export const generatorConfig = {
  dateTypeOptions: [
    'LocalDateTime',
    'LocalDate',
    'Date',
    'Timestamp'
  ],
  switchOptions: [
    {
      label: '启用',
      value: true
    },
    {
      label: '禁用',
      value: false
    }
  ],
  swaggerOptions: [
    {
      label: '禁用',
      value: 'disabled'
    },
    {
      label: 'Swagger',
      value: 'swagger'
    }, {
      label: 'Knife4j',
      value: 'knife4j'
    }
  ],
  pager: [
    {
      label: 'PageHelper',
      value: 'PageHelper'
    },
    {
      label: 'MybatisPage',
      value: 'MybatisPage'
    }
  ]
}

export const sqlPlaceholder  = `CREATE TABLE novel_test (
  id int NOT NULL AUTO_INCREMENT,
  name varchar(32) DEFAULT NULL,
  create_time datetime DEFAULT NULL,
  extra varchar(255) DEFAULT NULL,
  PRIMARY KEY (id)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci`

export const javaTypeOptions = [
  'Boolean',
  'Character',
  'Byte',
  'Short',
  'Integer',
  'Long',
  'Float',
  'Double',
  'String',
  'BigDecimal',
  'LocalTime',
  'LocalDate',
  'LocalDateTime',
  'Date',
]
